const http = uni.$u.http

// 结算订单
export const settleOrder = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/trade/settleOrder', params, config)

// 扫码进入计算订单
export const preSettleOrder = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/trade/pre/settleOrder', params, config)

/*
* 提交订单
* @invoiceType 10 - 增值税; 20 - 普票;*/
export const submitOrder = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/trade/submitOrder', params, config)

/*检查一个日期是否为节假日
* dateList [20210101,20210102,20210103,20210104]*/
export const checkHoliday = (params, config = { custom: { type: 'comUrl' }}) => http.post('/communalbase/date/checkHoliday', params, config)

// 检查购物车商品 【去结算按钮，检查商品基本信息】
export const checkCartProduct = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/trade/checkCartProduct', params, config)

// 取消购物车勾选
export const joinPromotion = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/cart/joinPromotion', params, config)
//获取配送时间
export const getPostTime = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/baseservice/common/getExpectedDeliveryTime', params, config)

//获取自提时间
export const getSelfPickupTime = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/baseservice/common/getSelfPickupTime', params, config)

//支付中心-预支付
export const prePay = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/payment/center/pre-pay', params, config)
//支付中心-统一支付接口
export const pay = (params, config = { custom: { type: 'ycUrl' }}) => http.post('/payment/center/pay', params, config)
